import request from '@/api/request.js'
import { formatGetUri } from '@/api/common.js'

const transaction = {}
const PORT1 = 'auhtority'
// 购物车
// 订单
// 支付
transaction.getShoppingList = params => request.globalRequest(`/sale/client/shopping/getList`, 'POST', params, request.USER)
transaction.joinShopping = params => request.globalRequest(`/sale/client/shopping/save`, 'POST', params, request.USER)
transaction.adjustShoppingQuantity = params => request.globalRequest(`/sale/client/shopping/adjust`, 'POST', params, request.USER)
transaction.removeShoppingByID = params => request.globalRequest(`/sale/client/shopping/remove`, 'POST', params, request.USER)

transaction.getOrderList = params => request.globalRequest(`/sale/client/order/getList`, 'POST', params, request.USER)
transaction.getOrderDetail = params => request.globalRequest(`/sale/client/order/getDetail`, 'POST', params, request.USER)
transaction.getOrderShopping = params => request.globalRequest(`/sale/order/getShopping`, 'POST', params, request.USER)
transaction.submitOrder = params => request.globalRequest(`/sale/client/order/save`, 'POST', params, request.USER)
transaction.removeOrder = params => request.globalRequest(`/sale/client/order/remove`, 'POST', params, request.USER)
transaction.copyOrder = params => request.globalRequest(`/sale/client/order/copy`, 'POST', params, request.USER)
transaction.submitPaymentOrder = params => request.globalRequest(`/sale/order/payment`, 'POST', params, request.USER)


transaction.submitPaymentAlipay = params => request.globalRequest(`/finance/revenue/alipay`, 'POST', params, request.USER)
transaction.submitPaymentWeixin = params => request.globalRequest(`/finance/revenue/weixin`, 'POST', params, request.USER)
transaction.submitPaymentWeixinApplet = params => request.globalRequest(`/finance/revenue/weixin-applet`, 'POST', params, request.USER)
transaction.submitPaymentBalance = params => request.globalRequest(`/finance/revenue/balance`, 'POST', params, request.USER)


transaction.submitAddress = params => request.globalRequest(`/sale/client/address/save`, 'POST', params, request.USER)
transaction.removeAddress = params => request.globalRequest(`/sale/client/address/remove`, 'POST', params, request.USER)
transaction.getAddressList = params => request.globalRequest(`/sale/client/address/getList`, 'POST', params, request.USER)
transaction.getAddressDetail = params => request.globalRequest(`/sale/client/address/getDetail`, 'POST', params, request.USER)
transaction.getAddressSelected = params => request.globalRequest(`/sale/client/address/getSelected`, 'POST', params, request.USER)

export default transaction